﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace ProjectEuler.Data
{
    internal sealed class NotConverter : IValueConverter
    {
        public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
        {
            if (value is Boolean)
            {
                return !((Boolean)(value));
            }

            return false;
        }

        public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture)
        {
            return Convert(value, targetType, parameter, culture);
        }
    }
}
